<?php
apf_require_page("Portal_Layout_Default");

class Portal_Home_ProfilePage extends Portal_Layout_DefaultPage {
    public function get_view () {
        $this->assign_data("user",$this->request->get_attribute("user"));
        $this->assign_data("sub_users",$this->request->get_attribute("sub_users"));
        $this->assign_data("derector_direct_yes",$this->request->get_attribute("derector_direct_yes"));
        $this->assign_data("derector_direct_no",$this->request->get_attribute("derector_direct_no"));
        $this->assign_data("error_item",$this->request->get_attribute("error_item"));

        return "Profile";
    }

    public static function use_boundable_styles() {
        $path = apf_classname_to_path(__CLASS__);
        return array_merge(parent::use_boundable_styles(), array($path."Profile.css"));
    }

    public static function use_boundable_javascripts() {
        $path = apf_classname_to_path(__CLASS__);
        return array_merge(parent::use_boundable_javascripts(), array($path."Profile.js"));
    }
    public static function use_javascripts() {
        return array_merge(parent::use_javascripts(),
            array(
                PageHelper::pure_static_url("/js/jquery.form.js"),
                PageHelper::pure_static_url("/js/jquery.Jcrop.js"),
                PageHelper::pure_static_url("/js/jquery.Jcrop.min.js"),
            )
        );
    }
    public function get_title(){
        $user = $this->request->get_attribute("user");
        return "{$user['real_name']}的个人主页";
    }
}